
  

  use "$FA_datasets/data_landarea", clear

 

keep if parcel_size_gps!=. & parcel_size_gps!=0 /*keep only obs with positive measured area GPS and self reported */
drop if parcel_size_farmer==. |   parcel_size_farmer==0


*construct measure of farm size at HH level
cap drop firstobs
bys hhid surveyround  :  egen farm_size_farmer=sum(parcel_size_farmer)
bys hhid surveyround  :  egen farm_size_gps=sum(parcel_size_gps)
bys hhid surveyround  :   gen firstobs=_n

gen ln_farm_size_farmer=ln(farm_size_farmer)
gen ln_farm_size_gps=ln(farm_size_gps)

gen ln_parcel_size_farmer=ln(parcel_size_farmer)
gen ln_parcel_size_gps=ln(parcel_size_gps)




      twoway ( kdensity ln_parcel_size_farmer  ,  lcolor(edkblue) lwidth(medthick)  ) ///
(kdensity ln_parcel_size_gps , lcolor(red) lwidth(medthick) lpattern(dash)  ) ,  ///
  legend(off ) ylabel(0(0.2)0.6) yscale(range(0 0.6 ))   plotregion(style(none)) xtitle("ln(area)") 
  
  graph export  "$FA_results/fig_ME_parcel.png", replace 
  
    twoway ( kdensity ln_farm_size_farmer  if firstobs==1,  lcolor(edkblue)  lwidth(medthick)  ) ///
(kdensity ln_farm_size_gps if firstobs==1, lcolor(red) lwidth(medthick) lpattern(dash)  ) ,  ///
  legend(off ) ylabel(0(0.2)0.6) yscale(range(0 0.6 )) plotregion(style(none)) xtitle("ln(area)") 
  
  graph export  "$FA_results/fig_ME_farm.png", replace 
  
  
  